package com.sch.www.codeGenerator.dao;

import com.sch.www.codeGenerator.base.CodeGeneratorConstant;

import java.util.ArrayList;
import java.util.List;

public class ele {


    public static void main(String[] args) throws Exception {
        GeneratorProperties gp = new GeneratorProperties();

        List<Table> tableList = new ArrayList<>();
        tableList.add(new Table("ele_elevator", "Elevator"));
        tableList.add(new Table("ele_care_group", "CareGroup"));
        tableList.add(new Table("ele_care_member", "CareMember"));
        tableList.add(new Table("ele_care_member_to_elevator", "CareMemberToElevator"));
        tableList.add(new Table("ele_care_unit", "CareUnit"));
        tableList.add(new Table("ele_care_user", "CareUser"));
        tableList.add(new Table("com_dic_region", "Region"));
        gp.setTableList(tableList);


        gp.setEntityTargetProject("service-api/ele-api/src/main/java");
        gp.setEntityPackageName("com.sch.www.ele.entity");
        gp.setEntityRootClass(CodeGeneratorConstant.BASE_ENTITY);

        gp.setDaoTargetProject("service-api-impl/ele-api-server/src/main/java");
        gp.setDaoPackageName("com.sch.www.ele.mapper");

        gp.setMapperTargetProject("service-api-impl/ele-api-server/src/main/resources");
        gp.setMapperPackageName("mapper.auto");


        GeneratorProperties.Db db = new GeneratorProperties.Db();
        db.setUserName("root");
        db.setPassword("hong10086");
        db.setDriverClassName("com.mysql.jdbc.Driver");
        db.setConnectionURL("jdbc:mysql://106.12.95.23:3306/mp");
        db.setDriverLocation(System.getProperty("user.dir") + "/code-gener/lib/mysql-connector-java-5.1.38.jar");
        gp.setDb(db);


        MybatisGenerator g = new MybatisGenerator(gp);
        g.generator();


    }


}
